package thread;
class MyThred extends Thread{
    @Override
    public void run() {
        while (true){
            System.out.println("hello thred");
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                throw new RuntimeException(e);
//            }
            //让线程主动进行"阻塞状态",主动放弃去CPU上执行
        }

    }
}
public class Demo1 {
    public static void main(String[] args) {
        Thread t=new MyThred();
        t.start();
        while (true){
            System.out.println("hello mian");
//            try {
//                Thread.sleep(1000);
//            } catch (InterruptedException e) {
//                throw new RuntimeException(e);
//            }
        }

    }

}
